
begintalkscript;
variables;

begintalknode 1;
	state = -1;
	nextstate = 2;
	question = "Sergeant Parks";
	text1 = "For some reason sergeant Parks has stopped in front of a door here. He looks nervous as he motions you to come closer. _Shh! Be as quiet as you can!_";
	text2 = "You stop Parks for a moment for a quick exchange. _What is it?_ He whispers.";
	text3 = "Parks lets out a surprised whistle. _We killed that ogre wizard. Incredible! I remember seeing him before. The sheer power of him... So, what now?_";
	code = if ((char_on_loc(15,10) == -1) && (get_flag(1,7) == 0)) {
			remove_string(1);
			remove_string(3);
}
		if (char_on_loc(15,10) == TRUE) {
			remove_string(2);
			remove_string(3);
}

		if (get_flag(1,7) >= 1) {
			remove_string(1);
			remove_string(2);
}
 break;

begintalknode 2;
	state = 2;
	nextstate = -1;
	condition = get_flag(1,1) == 0 && char_on_loc(15,10) == -1;
	question = "Hold it, Parks!";
	text1 = "_You got it! I'll hold ths position until further notice._";
	action = END_TALK;
	code =
		set_mobility(9,0);
		set_flag(1,1,1);
	break;
begintalknode 3;
	state = 2;
	nextstate = -1;
	condition = get_flag (1,1) == 1 && char_on_loc(15,10) == -1;
	question = "Parks! Get a move on!";
	text1 = "_Roger that! Death to the ogres!_";
	action = END_TALK;
	code =
		set_mobility(9,1);
		set_flag(1,1,0);
	break;
begintalknode 4;
	state = 2;
	nextstate = 3;
	condition = char_on_loc(15,10) == 9;
	question = "Parks, why did you stop?";
	text1 = "The sergeant points at the door. _There's a lot of noise coming from there. I think there's a large group of ogres inside and I think I heard wolves growl too. But what's worst is that I can sense magic behind this door._";
	text2 = "_And let me tell you; I am definitely not good at sensing magic. So, what do you think is the best way to proceed?_";

begintalknode 5;
	state = 3;
	nextstate = -1;
	question = "I say, we wait until everyone is here and then we will go through the door first.";
	text1 = "_Alright. Then that's what we'll do. I'd suggest you use whatever enhancing potions or magic you have on you before you storm in. Good luck and we'll be right behind you._ The soldiers form up behind you.";
	text2 = "They wait for you to attack.";
	action = END_TALK;
	code =
		relocate_character(0,14,10);
		relocate_character(1,14,11);
		relocate_character(2,14,12);
		relocate_character(3,15,12);
		
		if (char_ok(10) == TRUE) {
			stop_moving(10);
			relocate_character(10,14,13);
		}
		if (char_ok(11) == TRUE) {
			stop_moving(11);
			relocate_character(11,15,13);
		}
		if (char_ok(12) == TRUE) {
			stop_moving(12);
			relocate_character(12,14,14);
		}
		if (char_ok(13) == TRUE) {
			stop_moving(13);
			relocate_character(13,15,14);
		}
		if (char_ok(14) == TRUE)
			relocate_character(14,14,15);
		if (char_ok(15) == TRUE)
			relocate_character(15,15,15);
		if (char_ok(16) == TRUE)
			relocate_character(16,14,16);
	set_flag(1,1,5);
	break;
begintalknode 6;
	state = 3;
	nextstate = -1;
	question = "I say we wait until everyone is here and then you soldiers will storm in first.";
	text1 = "_Alright. That sounds like a solid plan. We'll go in an pin the ogres down. Then you come in and pick them off one by one._ The soldiers gather behind the door. Parks kicks it in and the soldiers rush in.";
	text2 = "From the room you can hear the shocked growls of the ogres.";
	action = END_TALK;
	code =
		if (char_ok(9) == TRUE) {
			relocate_character(9,14,8);
			stop_moving(9);
		}
		if (char_ok(10) == TRUE) {
			relocate_character(10,14,9);
			stop_moving(10);
		}
		if (char_ok(11) == TRUE) {
			relocate_character(11,15,8);
			stop_moving(11);
		}
		if (char_ok(12) == TRUE) {
			relocate_character(12,15,7);
			stop_moving(12);
		}
		if (char_ok(13) == TRUE) {
			relocate_character(13,17,7);
			stop_moving(13);
		}
		if (char_ok(14) == TRUE) {
			relocate_character(14,14,7);
			stop_moving(14);
		}
		if (char_ok(15) == TRUE) {
			relocate_character(15,16,7);
			stop_moving(15);
		}
		if (char_ok(16) == TRUE) {
			relocate_character(16,16,9);
			stop_moving(16);
		}
		set_terrain(15,9,16);
		force_instant_terrain_redraw();
	set_flag(1,1,5);
	break;

begintalknode 7;
	state = -1;
	nextstate = 3;
	question = "Parks Interrupts";
	text1 = "You are stopped by sergeant Parks grabbing your shoulder. _Ssh! Listen!_ He points at the door in front of you. You press your ear against the door and hear how a large group of ogres grunts at each other behind it. ";
	text2 = "Judging by the noise they are making you would guess that there are at least a half a dozen ogres behind this door. _So what do we do now?_ Parks asks, handing the authority over to you once more.";

begintalknode 8;
	state = 2;
	nextstate = -1;
	condition = char_on_loc(15,10) == 9;
	question = "I can't open the gate over there. Any sugestions?";
	text1 = "_It's no wonder you can't open the gate; the Yelbro merchants were serious about protecting their valuables. I don't think there is any other way to open the gate besides using a key. If you don't have the key we can't open the gate._";
	text2 = "_Of course if we had some explosives we could blast a hole in the wall. A really powerful mage might also be able to blow his way through the walls. But seeing as there are no mages of that caliber in Quarhag Pass, our best bet is finding the key._";

begintalknode 9;
	state = 2;
	nextstate = -1;
	condition = get_flag(1,7) >= 1;
	question = "Now you gather all the surviving soldiers and head back to Passton.";
	text1 = "_Can do. We'll meet you in Passton after you're done here._ Parks eyes run over what is left of his squad. He tries a smile. It does not quite stick. _I just wanted to say that if it wasn't... I mean, it's been..._ He chuckles a dry emotionless breath.";
	text2 = "_I guess I can say whatever I want to say once I've organized my thoughts. We'll see you in Passton._ The soldiers line up behind Parks and file out of the trade post.";
	action = END_TALK;
	code = erase_char(1003);
		set_flag(60,1,1);
 break;

begintalknode 10;
	state = 2;
	nextstate = -1;
	condition = get_flag(1,7) >= 1;
	question = "You wait right here. We'll all leave once I'm done here.";
	text1 = "_Alright, we'll mop up any ogres we'll come across and head back to Passton once you give us the all clear._";
	action = END_TALK;
	
